import Vue from 'vue'
import echarts from 'echarts'
import Element from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN'
import Validation, { Config } from '@/utils/validation'

Vue.prototype.$permiss = (arr, txt) => {
  let show = false
  arr.forEach(a => {
    if (a.txt === txt) {
      show = a.checked
    }
  })
  return show
}

Vue.use(Element, { locale })

Vue.use(Validation, Config)

Vue.prototype.$echarts = echarts
const w = document.body.clientWidth
Vue.prototype.$tableHeight = w / 1920 * (w >= 1920 ? 728 : 666) + 'px'
Vue.prototype.$dialogTableHeight = w / 1920 * (w >= 1920 ? 522 : 456) + 'px'
